-- Used in conjunction with the "Animation: Interactive - Constrain to Line"
-- behavior, allows a QuickTime sprite to be controlled by
-- a slider (and to have the slider move in response to movie
-- playback).
-- v1 - 14 October 1998 by Darrel Plant
-- 7 January 2000: added isOKToAttach handler and removed resulting redundant
-- error checking code - Karl Miller
on getBehaviorDescription
return \
"QuickTime Control Slider" & RETURN & RETURN & \
"Use this behavior in conjunction with the Animation: Interactive 'Constrain to Line' behavior to create a slider control for QuickTime digital videos. " & \
"Attach the 'Constrain' behavior to the slider and set its parameters and put this behavior on the digital video sprite." & RETURN & RETURN & \
"PARAMETERS:" & RETURN & \
" - channel number of Slider sprite." & RETURN & RETURN & \
"PERMITTED TYPES:" & RETURN & \
"#QuickTimeMedia"
end getBehaviorDescription
on getBehaviorTooltip me
return \
"Use in conjunction with the Constrain to Line behavior (in the Animation > Interactive library) to create a slider that can respond to QuickTime playback."
end getBehaviorTooltip
-- PROPERTIES --
property pSprite -- digital video sprite object
property pDuration -- digital video length (ticks)
-- author-defined properties
property pSliderSprite -- channel for digital video slider
-- EVENT HANDLERS --
on beginSprite me
mInitialize me
end beginSprite
on prepareFrame me
mUpdate me
end prepareFrame
-- CUSTOM HANDLERS --
on mInitialize me
-- cache sprite object
pSprite = sprite (me.spriteNum)
-- determine length of digital video
pDuration = pSprite.duration
end mInitialize
on mUpdate
-- convert current movie time to float value from 0 to 1
vValue = float (pSprite.movietime) / pDuration
-- send slider message containing new setting value, FALSE
-- flag indicates that slider will not send new value back to